package com.example.spidertp.core.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.spidertp.core.mapper.OperationRecordMapper;
import com.example.spidertp.core.mapper.TpWarningNoticeMapper;
import com.example.spidertp.core.model.entity.OperationRecord;
import com.example.spidertp.core.model.entity.TpWarningNotice;
import com.example.spidertp.core.model.param.WarningNoticeQueryParam;
import com.example.spidertp.core.service.TpWarningNoticeService;
import org.springframework.stereotype.Service;

/**
 * @author xiong.bo
 * @version 1.0
 * @date 2023/8/27 11:19 上午
 */

@Service
public class TpWarningNoticeServiceImpl extends ServiceImpl<TpWarningNoticeMapper, TpWarningNotice>
        implements TpWarningNoticeService {

    @Override
    public IPage<TpWarningNotice> selectByPage(WarningNoticeQueryParam param) {
        Page<TpWarningNotice> page = new Page(param.getPage(), param.getSize());
        LambdaQueryWrapper<TpWarningNotice> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.orderByDesc(TpWarningNotice::getCreateTime);
        return page(page, queryWrapper);
    }
}
